package com.tnsw.noxnox.signin;

import com.tnsw.noxnox.R;
import com.tnsw.noxnox.R.layout;
import com.tnsw.noxnox.R.menu;

import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.ListView;

public class SigninActivity extends Activity implements OnItemClickListener {

	private String tag = "SigninActivity";
	private SigninAdapter mAdapter;
	private ListView lv;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_signin);
		
		this.getActionBar().setDisplayHomeAsUpEnabled(true);
		
		this.lv = (ListView) this.findViewById(R.id.signin_listview);
		lv.setDescendantFocusability(ListView.FOCUS_BLOCK_DESCENDANTS);
		this.mAdapter = new SigninAdapter(this);
		lv.setAdapter(this.mAdapter);
		lv.setItemsCanFocus(false);
		lv.setOnItemClickListener(this);
		
		
	}
	
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
			case android.R.id.home:
				this.finish();
				
				break;
		}
		
		return(true);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.signin, menu);
		return true;
	}

	@Override
	public void onItemClick(AdapterView<?> arg0, View view, int position, long id) {
		Log.d(tag, "onItemClick(view=" + view.getClass().getName() + ")");
		if (position == 0) {
			
		}
	}

}
